<?php defined('SYSPATH') or die('No direct script access.');

class Model_Organization extends Model_Base
{
	public function add_category($name, $date_create, $user_id)
	{
		$info = array('name' => $name, 'date_create' => $date_create, 'user_id' => $user_id);
		return $this->add('category', $info);
	}
	public function add_category_2_organization($category_id, $organization_id)
	{
		return $this->add('category_organization', array(
			'organization_id' => $organization_id,
			'category_id'	  => $category_id
		));
	}
	public function add_user_2_organization($user_id, $organization_id, $job)
	{
		return $this->add('organization_user', array(
			'organization_id' 	=> $organization_id,
			'user_id'	  		=> $user_id,
			'job'				=> $job,
			'is_removed'		=> 0,
			'date_added'		=> DB::expr('NOW()')
		));
	}
	public function add_organization($info)
	{
		return $this->add('organization', $info);
	}
}